#include "precomp.h"

#pragma once

#include "GameObject.h"
#include "Map.h"
#include "Gun.h"
#include "Bullet.h"

class Character : public GameObject{
public:
	Character(const char* image_path, CL_GraphicContext *gc, Map *map, char map_sign, int hp = 100, float speed = 0.2, float collision_radius = 8.5);

	~Character();

	virtual void tick(float delta_time);

	void damage(int dmg);

	bool is_dead();

	void collide_character(Character *ch);

	void draw(float player_x, float player_y);

	void draw_bullets(float player_x, float player_y);

	void switch_gun(int gun_number);

	void shoot();

	void reload();

	inline int get_hp(){
		return _hp;
	}

	inline int get_bullets(){
		return _guns[_gun_number]->get_bullets();
	}

	inline int get_clips(){
		return _guns[_gun_number]->get_clips();
	}

	inline int get_gun_number(){
		return _gun_number;
	}

protected:
	list<Character*> _collide_characters;

	float _speed;
	
	int _hp;

	int _gun_number;

	char _map_sign;

	list<Bullet*> _bullets;

	Gun *_guns[5];
};